package com.moter.demo01.streamcaculator;

import java.math.BigInteger;
import java.util.Comparator;
import java.util.Optional;
import java.util.stream.Stream;

public class OptionalDemo {
    public static void main(String[] args) {
        Stream<String> split = Stream.of("The @RestController annotation tells Spring that this code describes an endpoint that should be made".split(" "));
//        Optional<String> max = split.max(Comparator.comparing(String::length));
//        System.out.println(max.orElse(""));
        System.out.println(split.min(Comparator.comparing(String::length)).map(m -> m = m.length() + "").orElse("0"));
        System.out.println(Integer.MAX_VALUE-Long.parseLong(String.valueOf(new StringBuffer("1534236469").reverse())));
        System.out.println(Math.pow(2,32)-Long.parseLong(String.valueOf(new StringBuffer("1534236469").reverse())));
        int i = Integer.parseInt(String.valueOf(new StringBuffer("1534236469").reverse()));
        char[] chars = "2".toCharArray();
        System.out.println(i);
    }
}
